package OnTap;

import java.util.Scanner;

public class Bai8 {

	/**
	 * @param args
	 */
	public static void SetMatrix(int[][]a,int n){
		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if(i == j){
					a[i][j] = 1;
				}
				else a[i][j] = a[j][i] = a[i][j-1] + 1;
			}
		}
	}
	
	public static void ShowMatrix(int[][]a,int n){		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				System.out.print(a[i][j] + "  ");
			}
			System.out.println();
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner (System.in);
		System.out.print("Ma trận vuông đối xứng cón n = ");
		int n = s.nextInt();
		int[][] a = new int [n][n];
		SetMatrix(a,n);
		ShowMatrix(a, n);
		
	}

}
